import { BasicPageParams, BasicFetchResult } from '@/api/model/baseModel';

export type AccountParams = BasicPageParams & {
  account?: string;
  nickname?: string;
};

export type RoleParams = {
  roleName?: string;
  status?: string;
};

export type RolePageParams = BasicPageParams & RoleParams;

export type DeptParams = {
  deptName?: string;
  status?: string;
};

export type MenuParams = {
  component: string;
  level: number;
  name: string;
  order: number;
  parent_id: number;
  is_show: string;
  title: string;
  url: string;
  id?: string;
};

export type AccessParams = {
  id: number;
  is_show: number;
  menu_id: number;
  name: string;
  parent_id: number;
};

export interface AccountListItem {
  id: string;
  account: string;
  email: string;
  nickname: string;
  role: number;
  createTime: string;
  remark: string;
  status: number;
}

export interface DeptListItem {
  id: string;
  orderNo: string;
  createTime: string;
  remark: string;
  status: number;
}

export interface MenuListItem {
  id: string; // 菜单ID
  level: string; // 菜单级别
  parent_id: number; // 父级ID
  url: string; // 路由地址
  order: number; // 排序
  is_show: number; // 是否展示 0不显示  1显示
  created_at: string; // 创建时间
  updated_at: string; // 修改时间
  children: MenuListItem[]; // 子集菜单
}

export interface AccessItem {
  api: string;
  children: AccessItem[];
  created_at: string;
  auth_code: string;
  id: number;
  is_show: number;
  menu_id: number;
  method: string;
  name: string;
  parent_id: number;
  updated_at: string;
}

export interface RoleListItem {
  id: string;
  roleName: string;
  roleValue: string;
  status: number;
  orderNo: string;
  createTime: string;
}
export interface AuthAccessItem {
  api: string;
  children: AuthAccessItem[];
  created_at: string;
  auth_code: string;
  id: number;
  is_show: number;
  menu_id: number;
  method: string;
  name: string;
  parent_id: number;
  updated_at: string;
}

export interface INotification {
  id: number;
  type_id: number;
  type_name: string;
  related_module: number;
  related_order_id: number;
  state_id: number;
  state_name: string;
  tips_desc: string;
}

/**
 * @description: Request list return value
 */
export type AccountListGetResultModel = BasicFetchResult<AccountListItem>;

export type DeptListGetResultModel = BasicFetchResult<DeptListItem>;

export type MenuListGetResultModel = BasicFetchResult<MenuListItem>;

export type AccessListGetResultModel = AccessItem[];

export type RolePageListGetResultModel = BasicFetchResult<RoleListItem>;

export type PageAutAccessGetResultModel = BasicFetchResult<AuthAccessItem>;

export type INotificationGetResultModel = BasicFetchResult<INotification>;
